package cn.iocoder.yudao.module.custom.controller.admin.industry;


import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.module.custom.convert.industry.IndustryConvert;
import cn.iocoder.yudao.module.custom.dal.dataobject.industry.IndustryDO;
import cn.iocoder.yudao.module.custom.service.industry.IndustryService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

import java.util.List;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;


/**
 * @author Administrator
 */
@Tag(name = "管理后台 - 行业分类信息")
@RestController
@RequestMapping("/custom/industry")
@Validated
public class IndustryController {

    @Resource
    private IndustryService industryService;


    @GetMapping("/getSecondaryIndustryList/{industryCode}")
    @OperateLog(enable = false)
    @Operation(summary = "获得商户信息分页")
    public CommonResult getSecondaryIndustryList(@PathVariable Integer industryCode) {
        List<IndustryDO> secondaryIndustryList = industryService.getSecondaryIndustryList(industryCode);
        return success(IndustryConvert.INSTANCE.convertList(secondaryIndustryList));
    }

}
